package cn.tedu.yushougeproduct.mapper;

import cn.tedu.yushougeproduct.pojo.entity.ShoppingCart;
import cn.tedu.yushougeproduct.pojo.vo.ShoppingCartStandardVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> {

    void updateShoppingCartState(Long cartId,Long stateId);

    int updateCartTotalPrice(Long cartId);

    ShoppingCartStandardVO getStandardById(Long id);

    @Select("select * from shopping_cart where user_id = #{userId}")
    ShoppingCart getByUserId(@Param("userId") Long userId);
}
